﻿using BussinessObject.ObjectTwo;
using ProjectHK3.App_Code;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectHK3.ObjectTwo
{
    public partial class ChangePassword : System.Web.UI.Page
    {
        B_ChangePassword ex = new B_ChangePassword();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Label2.Text = Session["User"].ToString();
            }
        }

        protected void TextBox1_TextChanged(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (ex.ChangePassword(TextBox2.Text, TextBox1.Text, Session["User"].ToString()) == true)
            {
                Alert.Show("Change Password Sucsessful!");
                Response.Redirect("../ObjectTwo/Home.aspx");
            }
            else
            {
                Alert.Show("Change Password Fail");
            }

        }

        protected void Button2_Click(object sender, EventArgs e)
        {

        }
    }
}